
@extends('/layouts.app')
@section("content")
    <div class="container">
        <div class="row">
            <div class="col-sm-2">
                <ul class="list-group aside">
                    @forelse($types as $type)
                        <li class="list-group-item @if($id == $type->id) active @endif">
                            <a href="{{url("post/type/$type->id")}}">{{$type->name}}</a>
                        </li>
                    @empty
                        <li>您还没添加栏目呢</li>
                    @endforelse
                </ul>
            </div>
            <div class="col-sm-10">

                @forelse ($posts as $post)
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            {{ $post->title }}
                        </div>

                        <div class="panel-body">
                            {{ $post->body }}
                        </div>
                        <div class="panel-footer">
                            <fav
                                :id={{$post->id}}
                                :isfav={{$post->isFav()?"true":"false"}}
                            ></fav>
                        </div>

                    </div>
                @empty
                    <p>还没有文章呢</p>
                @endforelse

                {{ $posts->links() }}

            </div>
        </div>

    </div>
@endsection




